xen.git
15 years agolibxc: provide notification of final checkpoint to restore end
Ian Campbell [Tue, 7 Sep 2010 18:08:11 +0000 (19:08 +0100)]
libxc: provide notification of final checkpoint to restore end

When the restore code sees this notification it will restore the
currently in-progress checkpoint when it completes.

This allows the restore end to finish up without waiting for a
spurious timeout on the receive fd and thereby avoids unnecessary
error logging in the case of a successful migration or restore.

In the normal migration or restore case the first checkpoint is always
the last. For a rolling checkpoint (such as Remus) the notification is
currently unused but could be used in the future for example to
provide a controlled failover for reasons other than error

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: Fix NULL deref in libxl_ctx_free()
Gianni Tedesco [Tue, 7 Sep 2010 18:05:17 +0000 (19:05 +0100)]
libxl: Fix NULL deref in libxl_ctx_free()

xc_interface_close() will de-reference a NULL handle, check for this
condition in libxl_ctx_free() before calling.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: ship libxl_uuid.h, to unbreak out-of-tree libxl builds
Gianni Tedesco [Tue, 7 Sep 2010 18:04:39 +0000 (19:04 +0100)]
libxl: ship libxl_uuid.h, to unbreak out-of-tree libxl builds

Broken since introduction of libxl_uuid.h which defines a core API
data-type but it's not installed in include directory.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: include domain id in userdata path.
Ian Campbell [Tue, 7 Sep 2010 17:55:07 +0000 (18:55 +0100)]
libxl: include domain id in userdata path.

The userdata is specific to a particular incarnation of a domain and
the patch is therefor required to be unique to each incarnation. If
the user has explicitly configured a UUID in their domain
configuration then the path is no longer unique since
22124:22366e13f76d "xl: randomly generate UUIDs" which (correctly)
caused the uuid domain configuration option to be obeyed.

If userdata is not unique to each incarnation of a domain then
localhost live migration is broken because the target is created (and
writes its userdata) before the sender destroys the domain (and
deletes its userdata).

Strictly speaking I think the UUID is unnecessary but it is perhaps
helpful to people looking in the userdata directory, for debugging
etc.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl+xend: use correct paths for PV console when running bootloader
Ian Campbell [Tue, 7 Sep 2010 17:50:55 +0000 (18:50 +0100)]
libxl+xend: use correct paths for PV console when running bootloader

Makes "{xl,xm} create -c GUEST" work again with pygrub in interactive
mode which was broken by 21994:2e08ec0028e4

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: do not run bootloader on restore.
Ian Campbell [Fri, 3 Sep 2010 17:44:49 +0000 (18:44 +0100)]
xl: do not run bootloader on restore.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc: use a switch statement in xc_domain_restore.c::pagebuf_get_one.
Ian Campbell [Fri, 3 Sep 2010 17:43:00 +0000 (18:43 +0100)]
libxc: use a switch statement in xc_domain_restore.c::pagebuf_get_one.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc: logger: add newline when progress is complete
Ian Campbell [Fri, 3 Sep 2010 17:41:37 +0000 (18:41 +0100)]
libxc: logger: add newline when progress is complete

In xc_domain_save ensure that we signal completion at the end of each
batch.

This ensures that the next logged line starts on a new line. e.g. instead of:
     Savefile contains xl domain config
    xc: Saving memory: iter 3 (last sent 0 skipped 0): 0/32768    0%migration target: Transfer complete, requesting permission to start domain.
    migration sender: Target has acknowledged transfer.
what is desired is:
     Savefile contains xl domain config
    xc: Saving memory: iter 0 (last sent 0 skipped 0): 32768/32768  100%
    xc: Saving memory: iter 1 (last sent 32576 skipped 192): 32768/32768  100%
    xc: Saving memory: iter 2 (last sent 217 skipped 0): 32768/32768  100%
    xc: Saving memory: iter 3 (last sent 0 skipped 0): 32768/32768  100%
    migration target: Transfer complete, requesting permission to start domain.
    migration sender: Target has acknowledged transfer.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc: document save/restore protocol
Ian Campbell [Fri, 3 Sep 2010 17:38:11 +0000 (18:38 +0100)]
libxc: document save/restore protocol

Reverse engineered from the code, likely contains inaccuracies but I
think provides a base to work from.

Add symbolic names for the minus-flags.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxend: reserve vtd_mem on guest restore
Miroslav Rezanina [Fri, 3 Sep 2010 17:22:31 +0000 (18:22 +0100)]
xend: reserve vtd_mem on guest restore

There's need for free vtd_mem more memory for guest with
xen-unstable c/s 17529.  This memory is freed when guest is
created, but is not freed when guest is restored. So restore
guest fails due  to not enough of memory for guest.

Following patch uses same calculation of memory to free in guest
restore as is in guest creation.

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoQEMU_TAG update
Ian Jackson [Thu, 2 Sep 2010 18:12:42 +0000 (19:12 +0100)]
QEMU_TAG update

15 years agoxl: do not continue in the child and exec xenconsole in the parent
Stefano Stabellini [Thu, 2 Sep 2010 17:26:00 +0000 (18:26 +0100)]
xl: do not continue in the child and exec xenconsole in the parent

Currenctly console_autoconnect spawns a child that continues building
the domain while the parent exec's xenconsole; this patch inverts the
logic.

As a consequence autoconnect_console needs to be called twice: once for
pv guests at the beginning and once for hvm guests at the end.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: do not log lack of guest support for suspend event channel
Ian Campbell [Thu, 2 Sep 2010 17:16:28 +0000 (18:16 +0100)]
libxl: do not log lack of guest support for suspend event channel

Implementation of the suspend event channel is completely optional for
a guest so do not log this normal occurrence.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: support console autoconnect on restore
Ian Campbell [Thu, 2 Sep 2010 17:15:29 +0000 (18:15 +0100)]
xl: support console autoconnect on restore

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
15 years agoxl: randomly generate UUIDs
Gianni Tedesco [Thu, 2 Sep 2010 17:12:14 +0000 (18:12 +0100)]
xl: randomly generate UUIDs

This patch converts xl to randomly generate UUID's rather than using a
dodgy time-seeded PRNG. I have ignored various suggestions so far on
auto-generation of MAC addresses and left it as a topic for a future
patch to solve. In other words the behaviour stays the same it's just
using a true random source. This patch also implements the "uuid" config
file parameter in xl.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-By: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: parse the maxvcpus config file parameter
Stefano Stabellini [Thu, 2 Sep 2010 16:44:46 +0000 (17:44 +0100)]
xl: parse the maxvcpus config file parameter

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoMerge
Ian Jackson [Thu, 2 Sep 2010 15:51:53 +0000 (16:51 +0100)]
Merge

15 years ago[IA64] Rename irq_cfg->domain to irq_cfg->cpu_mask
Keir Fraser [Thu, 2 Sep 2010 12:36:53 +0000 (13:36 +0100)]
[IA64] Rename irq_cfg->domain to irq_cfg->cpu_mask

This patch is ia64 part of 22070:20920c12bc48.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agoVT-d: fix ia64 build
Keir Fraser [Thu, 2 Sep 2010 12:36:23 +0000 (13:36 +0100)]
VT-d: fix ia64 build

The identifier `dest_LowestPrio' is defined on only x86.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agoDisable ACPI APEI feature for ia64
Keir Fraser [Thu, 2 Sep 2010 12:35:40 +0000 (13:35 +0100)]
Disable ACPI APEI feature for ia64

The apei-io.c cannot be built on ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agohvm_op: Remove use of uint64_aligned_t from guest header file.
Keir Fraser [Thu, 2 Sep 2010 12:30:26 +0000 (13:30 +0100)]
hvm_op: Remove use of uint64_aligned_t from guest header file.

Manually pad to the required alignment instead.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoRevert 5b03813d8d6e "Make uint64_aligned_t and GUEST_HANDLE_64 visible to guests."
Keir Fraser [Thu, 2 Sep 2010 12:29:45 +0000 (13:29 +0100)]
Revert 5b03813d8d6e "Make uint64_aligned_t and GUEST_HANDLE_64 visible to guests."

This introduced non-ANSI gcc-isms into the guest-visible sections of
public headers. Not allowed after all.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agotools/xenstore: correctly handle errors from read_message
Daniel De Graaf [Wed, 1 Sep 2010 13:37:18 +0000 (14:37 +0100)]
tools/xenstore: correctly handle errors from read_message

The return value of read_message needs to be checked in order to avoid
waiting forever for a message if there is an error on the communication
channel with xenstore. Currently, this is only checked if USE_PTHREAD is
defined (by checking for read thread exit), and that path is prone to
deadlock if request_mutex is held while waiting.

Since the failure of read_message leaves the socket in an undefined
state, close the socket and force all threads waiting on a read to return.

This also fixes xs_read_watch in the case where a read thread is not
running (in particular, this will happen if !USE_PTHREAD) by having it
read from the communication channel in the same way as read_reply.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agox86 shadow: allocate all shadow memory in single pages
Tim Deegan [Wed, 1 Sep 2010 10:23:49 +0000 (11:23 +0100)]
x86 shadow: allocate all shadow memory in single pages
now that multi-page shadows need not be contiguous.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agox86 shadow: remove the assumption that multipage shadows are contiguous
Tim Deegan [Wed, 1 Sep 2010 10:23:48 +0000 (11:23 +0100)]
x86 shadow: remove the assumption that multipage shadows are contiguous
and move from page to page using the linked list instead.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agox86 shadow: explicitly link the pages of multipage shadows
Tim Deegan [Wed, 1 Sep 2010 10:23:48 +0000 (11:23 +0100)]
x86 shadow: explicitly link the pages of multipage shadows
together using their list headers.  Update the users of the
pinned-shadows list to expect l2_32 shadows to have four entries
in the list, which must be kept together during updates.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agox86 shadow: for multi-page shadows, explicitly track the first page
Tim Deegan [Wed, 1 Sep 2010 10:23:47 +0000 (11:23 +0100)]
x86 shadow: for multi-page shadows, explicitly track the first page
(where the refcounts are) and check that none of the routines
that do refcounting ever see the second, third or fourth page.
This is just stating and enforcing an existing implicit requirement.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agox86 intel: Disable XSAVE support.
Keir Fraser [Wed, 1 Sep 2010 09:19:14 +0000 (10:19 +0100)]
x86 intel: Disable XSAVE support.

It breaks HVM save/restore.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86_64: Ensure frame-table compression leaves MAX_ORDER aligned
Keir Fraser [Wed, 1 Sep 2010 09:17:49 +0000 (10:17 +0100)]
x86_64: Ensure frame-table compression leaves MAX_ORDER aligned
contiguous ranges of page_info structs. This allows page-pointer
arithmetic in places like our buddy allocator.

This restriction was already implicitly guaranteed, but it is good to
make it explicit in the pdx-related initialisation.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agohvm: Fix merging error in hvm_op.h
Keir Fraser [Wed, 1 Sep 2010 09:17:29 +0000 (10:17 +0100)]
hvm: Fix merging error in hvm_op.h

A couple of new hvm_op commands were erroneously ifdef'ed to be
accessible only to the toolstack.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agoMake uint64_aligned_t and GUEST_HANDLE_64 visible to guests.
Keir Fraser [Wed, 1 Sep 2010 09:17:16 +0000 (10:17 +0100)]
Make uint64_aligned_t and GUEST_HANDLE_64 visible to guests.

No reason to hide them and they're useful for building 32/64-bit
invariant hypercall structures.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86 p2m: Fix comment regarding mfn_valid().
Keir Fraser [Wed, 1 Sep 2010 09:16:39 +0000 (10:16 +0100)]
x86 p2m: Fix comment regarding mfn_valid().

MMIO pages are not always above max_page (e.g., >=4GB system with MMIO
in the RAM hole below 4GB).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86 mm: revert check in clear_mmio_p2m_entry() changed in 21940:e7afe98afd43
Allen Kay allen.m.kay@intel.com [Wed, 1 Sep 2010 08:48:52 +0000 (09:48 +0100)]
x86 mm: revert check in clear_mmio_p2m_entry() changed in 21940:e7afe98afd43

valid_mfn() cannot be used here as MMIO pages are always above max_mem.
Also added sanity checking for type == p2m_mmio_direct before clearing
page table entry.  This should fix both VT-d and SR-IOV issues reported
recently as there are no SR-IOV specific code in Xen.  As far as Xen
is concern, SR-IOV virtual function is just another PCI device.

Signed-off-by: Allen Kay allen.m.kay@intel.com
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
15 years agolibxl: builtin list types should be pass-by-reference
Ian Campbell [Tue, 31 Aug 2010 18:16:23 +0000 (19:16 +0100)]
libxl: builtin list types should be pass-by-reference

This makes all _destroy functions consistent wrt freeing the actual
reference passed in. Previously we were relying on the reference
contained within the type itself which worked but was semantically a
little confusing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: correct indentation of _libxl_types.c
Ian Campbell [Tue, 31 Aug 2010 18:15:42 +0000 (19:15 +0100)]
libxl: correct indentation of _libxl_types.c

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: correctly free Reference types in autogenerated destroy functions
Ian Campbell [Tue, 31 Aug 2010 18:14:57 +0000 (19:14 +0100)]
libxl: correctly free Reference types in autogenerated destroy functions

References types should be recursively destroyed and then the actual
reference itself should be destroyed.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: drop libxl_set_vcpucount, introduce libxl_set_vcpuonline
Stefano Stabellini [Tue, 31 Aug 2010 18:05:01 +0000 (19:05 +0100)]
libxl: drop libxl_set_vcpucount, introduce libxl_set_vcpuonline

This patch renames libxl_set_vcpucount to libxl_set_vcpuonline and
modifies the function to take a bitmap of online/offline vcpus as
parameter.

It also introduces a xenstore transaction to write the available cpus
to xenstore.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: run libxlgentypes with $(PYTHON)
Christoph Egger [Tue, 31 Aug 2010 16:51:51 +0000 (17:51 +0100)]
libxl: run libxlgentypes with $(PYTHON)

Attached patch fixes libxl build that broke in
changeset 22032:fa82b0540e8c.

It is common these days to use $(PYTHON) in the build system.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoMissing include in libxl_pci.c
Daniel De Graaf [Mon, 30 Aug 2010 13:59:12 +0000 (14:59 +0100)]
Missing include in libxl_pci.c

Missing include in tools/libxl/libxl_pci.c: lstat() call requires
<sys/stat.h>.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

15 years agolibxl: fix xenstore connection when run in domU
Daniel De Graaf [Mon, 30 Aug 2010 12:58:07 +0000 (13:58 +0100)]
libxl: fix xenstore connection when run in domU

When used in a domain other than the one running xenstore,
libxl_ctx_init will fail to connect even when xenstore is actually
available. Add a call to xs_domain_open to handle this case.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

15 years agoept: Put locks around ept_get_entry
Keir Fraser [Mon, 30 Aug 2010 07:39:52 +0000 (08:39 +0100)]
ept: Put locks around ept_get_entry

There's a subtle race in ept_get_entry, such that if tries to read an
entry that ept_set_entry is modifying, it gets neither the old entry
nor the new entry, but empty.  In the case of multi-cpu
populate-on-demand guests, this manifests as a guest crash when one
vcpu tries to read a page which another page is trying to populate,
and ept_get_entry returns p2m_mmio_dm.

This bug can also be fixed by making both ept_set_entry and
ept_next_level access-once (i.e., ept_next_level reads full ept_entry
and then works with local value; ept_set_entry construct the entry
locally and then sets it in one write).  But there doesn't seem to be
any major performance implications of just making ept_get_entry use
locks; so the simpler, the better.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
15 years agoRename irq_cfg->domain to irq_cfg->cpu_mask
Keir Fraser [Mon, 30 Aug 2010 07:38:26 +0000 (08:38 +0100)]
Rename irq_cfg->domain to irq_cfg->cpu_mask

From: Sheng Yang <sheng.yang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoUpdate MAINTAINERS file with AMD maintainers
Keir Fraser [Mon, 30 Aug 2010 07:31:57 +0000 (08:31 +0100)]
Update MAINTAINERS file with AMD maintainers

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
Acked-by: Wei Wang <wei.wang2@amd.com>
Acked-by: Mark Langsdorf <mark.langsdorf@amd.com>
15 years agoVT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR
Keir Fraser [Thu, 26 Aug 2010 10:16:56 +0000 (11:16 +0100)]
VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
15 years agoFix bind_irq_vector() destination
Keir Fraser [Thu, 26 Aug 2010 10:16:14 +0000 (11:16 +0100)]
Fix bind_irq_vector() destination

The "mask" covered all online cpus in the "domain". It should be used
as destination later, instead of using "domain" directly.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
15 years ago# HG changeset patch
Ian Campbell [Tue, 24 Aug 2010 17:42:59 +0000 (18:42 +0100)]
# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1282671421 -3600
# Node ID d1dd29a470ef1b9d2c77478a123326036dfe90bb
# Parent  d7a4adad9c328decbd384d87b23001aea8951b86
tools/libxc, tools/libelf: Relicense under LGPL v2.1

Relicense these two libraries under LGPL v2.1 only except where
individual files already included the "or later" provision.

Copyright holders have been contacted by Stephen Spector and have all
agreed this change.

Removed tools/libxc/ia64/aclinux.h since it appeared to be
unused. There is a separate, more up to date, copy in
xen/include/acpi/platform/aclinux.h which does appear to be used.

Clarify the license of MiniOS privcmd.h under the same terms as other
tools/include/xen-sys headers.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc: remove xc_ptrace
Ian Campbell [Tue, 24 Aug 2010 17:34:46 +0000 (18:34 +0100)]
libxc: remove xc_ptrace

It has been unused since 21732:eb34666befcc. There was no response to
my RFC regarding its removal
http://marc.info/?l=xen-devel&m=128170404422822 and unfortunately we
have not been able to trace down all copyright holders of this code
for the purposes of relicensing libxc.

The code will be available in mercurial if we need to retrieve it in
the future.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools/xenpaging: call pageout policy function in xenpaging_evict_page
Olaf Hering [Tue, 24 Aug 2010 17:33:25 +0000 (18:33 +0100)]
tools/xenpaging: call pageout policy function in xenpaging_evict_page

Notify policy about a page that was just paged out to disk.
Up to now the code called the opposite function, which clears the
(xenpaging internal) reference bit, instead of setting it and marking
the page as gone.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: treat sub-command main function like a regular C main() function
Ian Campbell [Tue, 24 Aug 2010 17:30:07 +0000 (18:30 +0100)]
xl: treat sub-command main function like a regular C main() function

Currently xl passes the entire argc+argv to each subcommand and relies
on the preservation of the global optind variable to ensure that the
subcommand correctly handles argument parsing (e.g. accounting for "xl
[command]" vs "xl -v [command]").

This requirement for individual sub-commands to parse arguments
relative to optind is subtle and prone to being forgotten (or simply
not expected). Several sub-commands have recently been broken in this
way (now fixed).

Therefore arrange that the argv+argc passed to the sub-commands looks
like you would expect for a regular C main function and includes
argv[0] equal to the command name with command specific arguments in
argv[1] onwards.

Since all sub-commands (currently) correctly obey the optind it is
sufficient to reset it to 1 (as described in getopt(3)) in order to
not break the sub-commands' own argument parsing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: correct argument parsing for some sub-commands.
Ian Campbell [Tue, 24 Aug 2010 17:29:21 +0000 (18:29 +0100)]
xl: correct argument parsing for some sub-commands.

XL sub-commands are expected to parse their arguments relative to the
global variable "optind" rather than treating argc+argv as zero
based. This is because the argc+argv passed to sub-commands include
the entire original command line, not just the sub command specific bits.

Not all commands do this and they are therefore broken if the user
uses "xl -v command", correct such problems

dump-core:
  - did not handle "-h" option.

{network,network2,block}-{attach,list,detach} :
  - handled arguments without reference to optind
  - checked number of arguments before processing getopt loop,
    breaking "-h" option handling

An example of the breakage:
    # xl -v block-list d32-2
    Vdev  BE  handle state evt-ch ring-ref BE-path
    block-list is an invalid domain identifier
    51712 0   1      4     13     8        /local/domain/0/backend/vbd/1/

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: do not leak path to dom0 attached disk after running bootloader
Ian Campbell [Tue, 24 Aug 2010 17:28:26 +0000 (18:28 +0100)]
libxl: do not leak path to dom0 attached disk after running bootloader

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: xc_domain_restore returns 0 on success, 1 on error
Ian Campbell [Tue, 24 Aug 2010 17:26:08 +0000 (18:26 +0100)]
libxl: xc_domain_restore returns 0 on success, 1 on error

Fix restore_common to handle it this way.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: improve vif2 parsing
Andre Przywara [Tue, 24 Aug 2010 17:19:19 +0000 (18:19 +0100)]
xl: improve vif2 parsing

vif2 parsing relies on counted strncmp() statements. Replace this
with a more robust automatic version.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: fix strtok() call in vif2 parsing
Andre Przywara [Tue, 24 Aug 2010 17:18:20 +0000 (18:18 +0100)]
xl: fix strtok() call in vif2 parsing

Fix fixes a hang when parsing the vif2 parameter.

According to the manpage subsequent calls to strtok() must use
NULL in the string parameter to keep the iteration going.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoFix typo in audit_p2m(), SHARED_P2M_ENTRY does not exist.
Keir Fraser [Tue, 24 Aug 2010 15:15:56 +0000 (16:15 +0100)]
Fix typo in audit_p2m(), SHARED_P2M_ENTRY does not exist.
Without this change, p2m.c fails to compile if P2M_AUDIT is enabled.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
15 years agoFix mce erst bug to pass build under i386.
Keir Fraser [Tue, 24 Aug 2010 15:14:50 +0000 (16:14 +0100)]
Fix mce erst bug to pass build under i386.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
15 years agobuildconfigs: update enable-xen-config
Keir Fraser [Tue, 24 Aug 2010 15:14:14 +0000 (16:14 +0100)]
buildconfigs: update enable-xen-config

Enable a bunch of new Xen options, primarily blktap, PCI passthrough
and platform PCI device (PVHVM).

Also set default for a bunch of non-Xen options which are not covered
by the defconfig.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
15 years agoDocument how 4gb_segment_notify notifys
Keir Fraser [Sun, 22 Aug 2010 08:53:51 +0000 (09:53 +0100)]
Document how 4gb_segment_notify notifys

15 years agomce: Provide ERST interface
Keir Fraser [Sun, 22 Aug 2010 08:53:15 +0000 (09:53 +0100)]
mce: Provide ERST interface

This patch is used to provide ERST write/read/clear operation
interface to Xen MCE.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
15 years agoImplement ACPI APEI ERST feature
Keir Fraser [Sun, 22 Aug 2010 08:52:18 +0000 (09:52 +0100)]
Implement ACPI APEI ERST feature

APEI are ACPI4.0 new features. It consists of ERST, BERT, HEST, and
EINJ.  ERST is used to save fault error log to a platform persistent
storage, so that when reboot os can retrieve the error log and handle
it.

This patch is used to implement ERST feature to Xen.  It consists of
3-level hierarchy: operation level, action level, and instru= ction
level.  Instruction do basic io; Action done by sequential
instructions parsed from ACPI ERST table; Operation done by
sequential actions defined by ACPI spec, providing erst_write/
erst_read/ erst_clear interfaces to MCE/ NMI/ PCIe error handling
mechanism, etc.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
15 years agox86: Automatically EOI guest-bound interrupts if guest takes too long.
Keir Fraser [Sun, 22 Aug 2010 08:37:08 +0000 (09:37 +0100)]
x86: Automatically EOI guest-bound interrupts if guest takes too long.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxl: poison data objects in auto-generated destructors
Gianni Tedesco [Fri, 20 Aug 2010 16:12:00 +0000 (17:12 +0100)]
xl: poison data objects in auto-generated destructors

Increase the probability of blowing up badly up during any
use-after-destroy scenarios.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxc: remus: unbreak after 21488:dd6bbdc42033
Brendan Cully [Thu, 19 Aug 2010 17:24:12 +0000 (18:24 +0100)]
libxc: remus: unbreak after 21488:dd6bbdc42033

The aforementioned patch missed several calls to read_exact, causing spurious
timeouts under Remus.

Also add a couple of additional error reports to rdexact.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: Disable opengl if info->opengl == 0 (correct sense of test)
Stefano Stabellini [Thu, 19 Aug 2010 17:15:44 +0000 (18:15 +0100)]
libxl: Disable opengl if info->opengl == 0 (correct sense of test)

Disable opengl if info->opengl == 0

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoQEMU_TAG update
Ian Jackson [Thu, 19 Aug 2010 17:13:01 +0000 (18:13 +0100)]
QEMU_TAG update

15 years agoQEMU_TAG update
Ian Jackson [Thu, 19 Aug 2010 16:51:39 +0000 (17:51 +0100)]
QEMU_TAG update

15 years agotools/python: fix xm list for Python 2.7
Michael Young [Thu, 19 Aug 2010 16:09:30 +0000 (17:09 +0100)]
tools/python: fix xm list for Python 2.7

This patch fixes
  Unexpected error: <type 'exceptions.AttributeError'>
This is due to xmlrpc changes in Python 2.7.  This patch should
fixe it for both old and new versions.

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotimers: Fix printk format specifier
Keir Fraser [Thu, 19 Aug 2010 15:24:13 +0000 (16:24 +0100)]
timers: Fix printk format specifier

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxl: use libxl_device_pci_destroy
Ian Campbell [Thu, 19 Aug 2010 14:33:43 +0000 (15:33 +0100)]
xl: use libxl_device_pci_destroy

[PATCH 16 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl/xl: Use libxl_vcpuinfo_destroy
Ian Campbell [Thu, 19 Aug 2010 14:32:56 +0000 (15:32 +0100)]
libxl/xl: Use libxl_vcpuinfo_destroy

Replaces libxl_free_vcpu_list.

The ->cpumap field is now always a unique allocation rather than each
being an offset into the cpumap allocated in the first
libxl_device_pci in the list.

Refactor vcpulist so that the two cases can share more code.

[PATCH 15 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl/xl: Use libxl_device_nic_destroy and libxl_nicinfo_destroy
Ian Campbell [Thu, 19 Aug 2010 14:32:28 +0000 (15:32 +0100)]
libxl/xl: Use libxl_device_nic_destroy and libxl_nicinfo_destroy

Replaces libxl_free_nics_list

[PATCH 14 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl/xl: use libxl_diskinfo_destroy and libxl_device_disk_destroy
Ian Campbell [Thu, 19 Aug 2010 14:31:46 +0000 (15:31 +0100)]
libxl/xl: use libxl_diskinfo_destroy and libxl_device_disk_destroy

[PATCH 13 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: destroy device model info after creation
Ian Campbell [Thu, 19 Aug 2010 14:31:14 +0000 (15:31 +0100)]
xl: destroy device model info after creation

[PATCH 12 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: use libxl_version_info_destroy, not hand-coded do_free_version_info
Ian Campbell [Thu, 19 Aug 2010 14:30:48 +0000 (15:30 +0100)]
libxl: use libxl_version_info_destroy, not hand-coded do_free_version_info

[PATCH 11 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: free the libxl types contained in struct domain_config
Ian Campbell [Thu, 19 Aug 2010 14:29:57 +0000 (15:29 +0100)]
xl: free the libxl types contained in struct domain_config

Resolves the following leaks found using "valgrind xl create -n ..."
(plus presumably others which didn't trigger because I have no devices
of that type)

[PATCH 10 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
==21241== 5 bytes in 1 blocks are definitely lost in loss record 1 of 6
==21241==    at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241==    by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241==    by 0x804E56B: parse_config_data (xl_cmdimpl.c:760)
==21241==    by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241==    by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241==    by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 6 bytes in 1 blocks are definitely lost in loss record 2 of 6
==21241==    at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241==    by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241==    by 0x804DAAA: parse_config_data (xl_cmdimpl.c:586)
==21241==    by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241==    by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241==    by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 24 bytes in 1 blocks are definitely lost in loss record 3 of 6
==21241==    at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241==    by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241==    by 0x804E51F: parse_config_data (xl_cmdimpl.c:754)
==21241==    by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241==    by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241==    by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 27 bytes in 1 blocks are definitely lost in loss record 4 of 6
==21241==    at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241==    by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241==    by 0x804DF4A: parse_config_data (xl_cmdimpl.c:664)
==21241==    by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241==    by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241==    by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 28 bytes in 1 blocks are definitely lost in loss record 5 of 6
==21241==    at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241==    by 0x410C1A7: vasprintf (in /lib/i686/cmov/libc-2.7.so)
==21241==    by 0x40EE59A: asprintf (in /lib/i686/cmov/libc-2.7.so)
==21241==    by 0x804CA8B: init_nic_info (xl_cmdimpl.c:322)
==21241==    by 0x804E6FF: parse_config_data (xl_cmdimpl.c:791)
==21241==    by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241==    by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241==    by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 44 bytes in 1 blocks are definitely lost in loss record 6 of 6
==21241==    at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241==    by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241==    by 0x804E168: parse_config_data (xl_cmdimpl.c:694)
==21241==    by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241==    by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241==    by 0x804B2FB: main (xl.c:76)

15 years agolibxl: implement destroy for libxl_file_reference builtin type
Ian Campbell [Thu, 19 Aug 2010 14:25:15 +0000 (15:25 +0100)]
libxl: implement destroy for libxl_file_reference builtin type

As well as freeing data any file mappings need to be torn down so
implement an explicit destroy function.

Also the map and unmap function are internal to libxl so make that so.

[PATCH 09 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: do not generate a destructor for data types which do not require one
Ian Campbell [Thu, 19 Aug 2010 14:24:41 +0000 (15:24 +0100)]
libxl: do not generate a destructor for data types which do not require one

libxl_dominfo, libxl_poolinfo, libxl_vminfo, libxl_domain_build_state,
libxl_physinfo and libxl_sched_credit contain no members which require
destruction so omit the auto generated destructor.

As an exception continue to generate destructors for libxl_device_*
and libxl_{devtype}* even if they have no interesting members so that
all device types can be treated the same without special knowledge
about the type contents being required.

[PATCH 08 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: build info bootloader{,_args} are not const.
Ian Campbell [Thu, 19 Aug 2010 14:21:29 +0000 (15:21 +0100)]
libxl: build info bootloader{,_args} are not const.

[PATCH 07 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: libxl_device_console.build_state is const
Ian Campbell [Thu, 19 Aug 2010 14:21:01 +0000 (15:21 +0100)]
libxl: libxl_device_console.build_state is const

This field always refers to a libxl_domain_build_state structure which
is managed already by the caller, therefore it is incorrect to free it
as part of libxl_device_console_destroy.

(arguably this field should be a copy of, not a reference too, the original)

[PATCH 06 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: generate destructors for each libxl defined type
Ian Campbell [Thu, 19 Aug 2010 14:20:22 +0000 (15:20 +0100)]
libxl: generate destructors for each libxl defined type

I chose the name "_destroy" rather than "_free" because the destructor
functions will free only the members of a type recursively but will
not free the actual type structure itself. The allocation of the type
is typically done by the caller and may not be a single allocation,
e.g. lists/arrays of types or embedded in other structures etc.

The exceptions to this rule are libxl_string_list_destroy and
libxl_key_value_list_destroy but I'm not 100% convinced they are
exceptions (since they are kind-of opaque) and I couldn't see a
cleanerway to express this concept. I have made a best effort attempt
to implement these functions sanely but since as far as I can tell
nothing in the current code base ever sets
libxl_domain_create_info.{xsdata,platformdata} I'm flying somewhat
blind.

[PATCH 05 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: autogenerate _libxl_types.h
Ian Campbell [Thu, 19 Aug 2010 14:15:55 +0000 (15:15 +0100)]
libxl: autogenerate _libxl_types.h

The libxl interface types are represented by a simple python data
structure (which could be parsed from a bespoke language in the
future).

This will allow the autogeneration of functions to free the component
members of the libxl types. In the future it may also enable auto
generation of type marshalling code for language bindings.

The generated file should be identical to before with the exception of
the "DO NOT EDIT" header.

It was unfortunately necessary to add explcit an dependency on
_libxl_types.h (indirectly via libxl.h) to all C files since the
autogenerated dependencies are not available in time.

[PATCH 04 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: tweak formatting of _libxl_types.h to better suit autogeneration
Ian Campbell [Thu, 19 Aug 2010 13:46:32 +0000 (14:46 +0100)]
libxl: tweak formatting of _libxl_types.h to better suit autogeneration

This makes it easier to do a before/after comparison when the file
becomes autogenerated.

[PATCH 03 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agolibxl: move type definitions into _libxl_types.h
Ian Campbell [Thu, 19 Aug 2010 13:45:36 +0000 (14:45 +0100)]
libxl: move type definitions into _libxl_types.h

The intention is to autogenerate this file in a future patch. This
pure code motion patch allows for easier before and after comparison
of that patch.

[PATCH 02 of 16 of
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxl: free all data on exit from the domain monitor daemon.
Ian Campbell [Thu, 19 Aug 2010 13:40:24 +0000 (14:40 +0100)]
xl: free all data on exit from the domain monitor daemon.

[PATCH 01 of 16
 libxl: autogenerate type definitions and destructor functions]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoUpdate MAINTAINERS file.
Keir Fraser [Wed, 18 Aug 2010 17:06:10 +0000 (18:06 +0100)]
Update MAINTAINERS file.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoMerge
Ian Jackson [Wed, 18 Aug 2010 16:11:13 +0000 (17:11 +0100)]
Merge

15 years agotools/libxl: fix "xl console" for primary console
Ian Campbell [Wed, 18 Aug 2010 16:09:59 +0000 (17:09 +0100)]
tools/libxl: fix "xl console" for primary console

libxl_console_constype is an enum and can therefore be unsigned so
using -1 as a sentinel for unset in main_console fails to work as
expected.

Arrange for all valid enum values to be > 0 and use 0 as the sentinal
instead.

If the user does not request a specific type then always use the
primary console since using "-n" but not "-t" is not meaningful as we
do not know which type to request.

Also make libxl_console_exec reject invalid values of type.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools/libxc: free thread specific hypercall buffer on xc_interface_close
Ian Campbell [Wed, 18 Aug 2010 16:09:25 +0000 (17:09 +0100)]
tools/libxc: free thread specific hypercall buffer on xc_interface_close

The per-thread hypercall buffer is usually cleaned up on pthread_exit
by the destructor passed to pthread_key_create. However if the calling
application is not threaded then the destructor is never called.

This frees the data for the current thread only but that is OK since
any other threads will be cleaned up by the destructor.

Changed since v1:
 * Ensure hcall_buf_pkey is initialised before use. Thanks to
   Christoph Egger for his help diagnosing this issue on NetBSD.
 * Remove redundant if (hcall_buf) from xc_clean_hcall_buf since
   _xc_clean_hcall_buf includes the same check.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools/xenpaging: Add _XOPEN_SOURCE to fix build problems with recent gcc
Daniel Kiper [Wed, 18 Aug 2010 15:48:25 +0000 (16:48 +0100)]
tools/xenpaging: Add _XOPEN_SOURCE to fix build problems with recent gcc

This patch fixes compilation issues with
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21).

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotimers: Simplify implementation logic.
Keir Fraser [Wed, 18 Aug 2010 13:56:01 +0000 (14:56 +0100)]
timers: Simplify implementation logic.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agotools/hotplug: 21549:8bcaec29574e breaks vif-script with arguments.
Brendan Cully [Wed, 18 Aug 2010 13:50:51 +0000 (14:50 +0100)]
tools/hotplug: 21549:8bcaec29574e breaks vif-script with arguments.

For example, (vif-script 'vif-bridge bridge=eth1') in xend-config.sxp will
cause vif-setup to attempt to execute 'vif-bridge bridge=eth1' due to a
quoting mismatch. The fix appears to be to remove the extra quotes around
"$script" in vif-setup.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotimers: Improve debug-key printing.
Keir Fraser [Wed, 18 Aug 2010 13:22:48 +0000 (14:22 +0100)]
timers: Improve debug-key printing.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86 cpuidle: check whether cpu is online in cpu idle control
Keir Fraser [Tue, 17 Aug 2010 18:32:37 +0000 (19:32 +0100)]
x86 cpuidle: check whether cpu is online in cpu idle control

We observed a 2.6.18.8 dom0 kernel crash when Xen has maxcpus < num
of physical cores (maxcpus=3D4 for a 12-core system). It appeared that
hypervisor doesn't check whether CPU is online or not. This small
patch fixed the issue.

Signed-off-by: Uwe Dannowski <uwe.dannowski@amd.com>
Acked-by: Wei Huang <wei.huang2@amd.com>
15 years agoxentrace: Fix buffer allocation to properly depend on T_INFO_PAGES
Keir Fraser [Tue, 17 Aug 2010 18:30:35 +0000 (19:30 +0100)]
xentrace: Fix buffer allocation to properly depend on T_INFO_PAGES

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
15 years agotools/libxl: fix leak in libxl_wait_for_backend()
Gianni Tedesco [Tue, 17 Aug 2010 16:23:25 +0000 (17:23 +0100)]
tools/libxl: fix leak in libxl_wait_for_backend()

Another leak was been introduced since the gc patch-set.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agotools/libxl: compile with -Wmissing-declarations
Ian Jackson [Tue, 17 Aug 2010 16:20:53 +0000 (17:20 +0100)]
tools/libxl: compile with -Wmissing-declarations

Since the recent build error caused by mismatch of symbol types due to
missing declarations, build libxl with -Wmissing-declarations.

The patch is mostly straightforward, a one liner in the makefile enables
the flag, a lot of functions in xl_cmdimpl.c needed to be made static
and libxl_paths.c needed to include libxl.h.

The one wart on the patch-set is that flex has a bug where it emits code
with missing declarations for yy(set|get)_column.  This can be worked
around by providing the declarations ourselves regardless.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoxend: remove non-ASCII characters.
Christoph Egger [Tue, 17 Aug 2010 14:23:36 +0000 (15:23 +0100)]
xend: remove non-ASCII characters.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

15 years agolibxl: xs_read accepts NULL for *len parameter
Ian Campbell [Mon, 16 Aug 2010 14:31:05 +0000 (15:31 +0100)]
libxl: xs_read accepts NULL for *len parameter

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

15 years agolibxl: do not GC data returned to the caller by libxl_device_disk_getinfo.
Ian Campbell [Mon, 16 Aug 2010 14:31:05 +0000 (15:31 +0100)]
libxl: do not GC data returned to the caller by libxl_device_disk_getinfo.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

15 years agolibxl: ensure result of libxl_poolid_to_name is always dynamically allocated
Ian Campbell [Mon, 16 Aug 2010 14:31:05 +0000 (15:31 +0100)]
libxl: ensure result of libxl_poolid_to_name is always dynamically allocated

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>